package com.lc.studymybatis.controller;

import com.github.pagehelper.PageInfo;
import com.lc.studymybatis.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
public class UserController {

    private Logger logger = LoggerFactory.getLogger(UserController.class);

    @Autowired
    private UserService userService;

    @GetMapping("getUser")
    @ResponseBody
    public PageInfo getUser() {
        PageInfo user = userService.getUser();
        return user;
    }


    @RequestMapping("index")
    public String getIndex(){
        return "index";
    }
}
